<template>
	<view>
		<!-- 遮罩 -->
		<view :class="active ? 'mask' : '' " @click="close"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				active: false
			}
		},
		methods: {
			close() {
				this.active = !this.active;
			}
		}
	}
</script>

<style scoped>
	.mask {
		position: fixed;
		left: 0;
		top: 0;
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, .5);
		z-index: 98;
	}
</style>
